bitkeeper revision 1.1159.1.107 (412dfaebCIngUElp8LanU3kSkz3C7Q)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Thu, 26 Aug 2004 14:59:55 +0000 (14:59 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Thu, 26 Aug 2004 14:59:55 +0000 (14:59 +0000)
Grant-table skeleton in Xen/Linux.

.rootkeys
linux-2.4.27-xen-sparse/arch/xen/kernel/Makefile
linux-2.4.27-xen-sparse/mkbuildtree
linux-2.6.7-xen-sparse/arch/xen/kernel/Makefile
linux-2.6.7-xen-sparse/arch/xen/kernel/gnttab.c [new file with mode: 0644]
linux-2.6.7-xen-sparse/include/asm-xen/gnttab.h [new file with mode: 0644]

index 78f0158385f468bccba30793184e1ff77c7a929e..9c4ba32482e64c42c491325677ec182a8d445de2 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 40f56239pYRq5yshPTkv3ujXKc8K6g linux-2.6.7-xen-sparse/arch/xen/kernel/empty.c
 40f56238xFQe9T7M_U_FItM-bZIpLw linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c
 4110f478aeQWllIN7J4kouAHiAqrPw linux-2.6.7-xen-sparse/arch/xen/kernel/fixup.c
+412dfae9eA3_6e6bCGUtg1mj8b56fQ linux-2.6.7-xen-sparse/arch/xen/kernel/gnttab.c
 40f56239sFcjHiIRmnObRIDF-zaeKQ linux-2.6.7-xen-sparse/arch/xen/kernel/process.c
 40f562392LBhwmOxVPsYdkYXMxI_ZQ linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c
 3f68905c5eiA-lBMQSvXLMWS1ikDEA linux-2.6.7-xen-sparse/arch/xen/kernel/xen_proc.c
 40f5623bxUbeGjkRrjDguCy_Gm8RLw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/xor.h
 40f5623bYNP7tHE2zX6YQxp9Zq2utQ linux-2.6.7-xen-sparse/include/asm-xen/ctrl_if.h
 40f5623b3Eqs8pAc5WpPX8_jTzV2qw linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h
+412dfaeazclyNDM0cpnp60Yo4xulpQ linux-2.6.7-xen-sparse/include/asm-xen/gnttab.h
 40f5623aGPlsm0u1LTO-NVZ6AGzNRQ linux-2.6.7-xen-sparse/include/asm-xen/hypervisor.h
 40f5623cndVUFlkxpf7Lfx7xu8madQ linux-2.6.7-xen-sparse/include/asm-xen/multicall.h
 3f108af1ylCIm82H052FVTfXACBHrw linux-2.6.7-xen-sparse/include/asm-xen/proc_cmd.h
index 02634ec4c275b55e22b075f215841a8e2626fb43..3ad868e3579640b6179185e5a034a5ec06f4a922 100644 (file)
@@ -6,12 +6,12 @@ all: kernel.o head.o init_task.o
 
 O_TARGET := kernel.o
 
-export-objs     := i386_ksyms.o
+export-objs     := i386_ksyms.o gnttab.o
 
 obj-y  := process.o semaphore.o signal.o entry.o traps.o irq.o  \
                ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o \
                i386_ksyms.o i387.o evtchn.o ctrl_if.o pci-dma.o \
-               reboot.o fixup.o
+               reboot.o fixup.o gnttab.o
 
 ifdef CONFIG_PCI
 obj-y  += pci-i386.o pci-pc.o
index ca407be27d8db3abfb270683d56e5ac631d584ff..eddff3d03516895ee83b100ed5727f26146441a3 100755 (executable)
@@ -206,6 +206,7 @@ ln -sf ../asm-i386/user.h
 ln -sf ../asm-i386/vm86.h 
 ln -sf ../../${LINUX_26}/include/asm-xen/ctrl_if.h
 ln -sf ../../${LINUX_26}/include/asm-xen/evtchn.h
+ln -sf ../../${LINUX_26}/include/asm-xen/gnttab.h
 ln -sf ../../${LINUX_26}/include/asm-xen/hypervisor.h
 ln -sf ../../${LINUX_26}/include/asm-xen/multicall.h
 ln -sf ../../${LINUX_26}/include/asm-xen/proc_cmd.h
@@ -223,6 +224,7 @@ ln -sf ../../i386/kernel/sys_i386.c
 ln -sf ../../../${LINUX_26}/arch/xen/kernel/ctrl_if.c
 ln -sf ../../../${LINUX_26}/arch/xen/kernel/evtchn.c
 ln -sf ../../../${LINUX_26}/arch/xen/kernel/fixup.c
+ln -sf ../../../${LINUX_26}/arch/xen/kernel/gnttab.c
 ln -sf ../../../${LINUX_26}/arch/xen/kernel/reboot.c
 ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/ioport.c
 ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/pci-dma.c
index 49714c6bfa4503194f702757277573f631d4b5ab..d4a167e6e102554007edf23483c236077324dede 100644 (file)
@@ -9,4 +9,5 @@ $(obj)/vmlinux.lds.s: arch/$(ARCH)/$(XENARCH)/kernel/vmlinux.lds.s
 
 extra-y += vmlinux.lds.s
 
-obj-y  := ctrl_if.o evtchn.o fixup.o process.o reboot.o xen_proc.o empty.o
+obj-y  := ctrl_if.o evtchn.o fixup.o process.o reboot.o xen_proc.o empty.o \
+           gnttab.o
diff --git a/linux-2.6.7-xen-sparse/arch/xen/kernel/gnttab.c b/linux-2.6.7-xen-sparse/arch/xen/kernel/gnttab.c
new file mode 100644 (file)
index 0000000..008dfa9
--- /dev/null
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * gnttab.c
+ * 
+ * Two sets of functionality:
+ * 1. Granting foreign access to our memory reservation.
+ * 2. Accessing others' memory reservations via grant references.
+ * (i.e., mechanisms for both sender and recipient of grant references)
+ * 
+ * Copyright (c) 2004, K A Fraser
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <asm-xen/gnttab.h>
+
+EXPORT_SYMBOL(gnttab_grant_foreign_access);
+EXPORT_SYMBOL(gnttab_end_foreign_access);
+EXPORT_SYMBOL(gnttab_grant_foreign_transfer);
+EXPORT_SYMBOL(gnttab_end_foreign_transfer);
+
+grant_ref_t
+gnttab_grant_foreign_access(
+    domid_t domid, unsigned long frame, int readonly)
+{
+    return 0;
+}
+
+void
+gnttab_end_foreign_access(
+    grant_ref_t ref, int readonly)
+{
+}
+
+grant_ref_t
+gnttab_grant_foreign_transfer(
+    domid_t domid)
+{
+    return 0;
+}
+
+unsigned long
+gnttab_end_foreign_transfer(
+    grant_ref_t ref)
+{
+    return 0;
+}
diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/gnttab.h b/linux-2.6.7-xen-sparse/include/asm-xen/gnttab.h
new file mode 100644 (file)
index 0000000..f7e6ed3
--- /dev/null
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * gnttab.h
+ * 
+ * Two sets of functionality:
+ * 1. Granting foreign access to our memory reservation.
+ * 2. Accessing others' memory reservations via grant references.
+ * (i.e., mechanisms for both sender and recipient of grant references)
+ * 
+ * Copyright (c) 2004, K A Fraser
+ */
+
+#ifndef __ASM_GNTTAB_H__
+#define __ASM_GNTTAB_H__
+
+#include <linux/config.h>
+#include <asm-xen/hypervisor.h>
+#include <asm-xen/hypervisor-ifs/grant_table.h>
+
+grant_ref_t
+gnttab_grant_foreign_access(
+    domid_t domid, unsigned long frame, int readonly);
+
+void
+gnttab_end_foreign_access(
+    grant_ref_t ref, int readonly);
+
+grant_ref_t
+gnttab_grant_foreign_transfer(
+    domid_t domid);
+
+unsigned long
+gnttab_end_foreign_transfer(
+    grant_ref_t ref);
+
+#endif /* __ASM_GNTTAB_H__ */